package com.sweet.satellite;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;


public class SatelliteSDK {
    public static String platform;
    public static int versionCode;
    public static String versionName;

    private SatelliteSDK() {
        super();
    }

    public static void init(Context context, String appPlatform, boolean debug) {
        GlobalConfig.setAppContext(context);
        SatelliteSDK.platform = appPlatform;
        try {
            PackageInfo packageInfo = GlobalConfig.getAppContext().getPackageManager().getPackageInfo(GlobalConfig
                    .getAppContext().getPackageName(), 0);
            SatelliteSDK.versionCode = packageInfo.versionCode;
            SatelliteSDK.versionName = packageInfo.versionName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        Config.setLastOpenTime(System.currentTimeMillis());
    }

    public static void onFirstLaunch() {
        if (Config.getIsFirstLaunch()) {
//          Config.setFirstSource(SourceUtils.getSource());
            Config.setCreateDate(System.currentTimeMillis());
            Config.setIsFirstLaunch(false);
        }
    }

}

